﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WF.Common;
using SourceCode.Workflow.Management;

namespace WF.Web.Pages.WorkSpace
{
    public partial class Release : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            WorkflowManagementServer wms = new WorkflowManagementServer();
            try
            {
                string workListItemID = this.Request.QueryString["WorkListItemID"];
                CentaUtil.CheckParam(workListItemID, "WorkListItem ID");
                wms.Open(WorkFlowHelper.GetK2ManagementServerConnectionString());
                wms.ReleaseWorklistItem(int.Parse(workListItemID));

                this.WindowClose(true);
            }
            catch (Exception ex)
            {
                this.Master.HandleException(ex, true);
            }
            finally
            {

                wms.Connection.Close();
                wms = null;
            }
        }
    }
}